package org.gurms.dao.po.system;

import java.io.Serializable;

import javax.persistence.Embeddable;

@Embeddable
public class SysDictPK implements Serializable {
	private String dicttype;
	private String dictcode;

	public String getDicttype() {
		return dicttype;
	}

	public void setDicttype(String dicttype) {
		this.dicttype = dicttype;
	}

	public String getDictcode() {
		return dictcode;
	}

	public void setDictcode(String dictcode) {
		this.dictcode = dictcode;
	}

	public boolean equals(Object o) {
		if (o == null || !(o instanceof SysDictPK)) {
			return false;
		} else {
			SysDictPK pk = (SysDictPK) o;
			if (pk.getDictcode() == null || pk.getDicttype() == null) {
				return false;
			} else {
				return pk.getDictcode().equals(dictcode)
						&& pk.getDicttype().equals(dicttype);
			}
		}
	}

	public int hashCode() {
		if (dicttype != null && dictcode != null) {
			return dicttype.hashCode() + dictcode.hashCode();
		} else {
			return super.hashCode();
		}
	}
}
